public class Test {
    public static void main(String[] args) {//err
        int[] array = {1, 2, 3, 4, 5, 6, 7};
        for (int i = 0; i < array.length - 1; i++) {
            if (array[i] % 2 == 0) {
                int tmp = array[i];
                array[i] = array[i + 1];
                array[i + 1] = tmp;
            }
        }
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i] + " ");
        }
    }





    public static void main1(String[] args) {
        int[] array = {2, 4, 6};
        transform(array);
    }

    public static void transform(int[] array) {
        for (int i = 0; i < array.length ; i++) {
            array[i] *= 2;
        }
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i] + " ");
        }
    }
}
